//引入“mongoose”依赖
const mongoose = require('mongoose');
//链接数据库
mongoose.connect('mongodb://localhost/user');

//数据结构：用户
const userSchema = new mongoose.Schema({
    username: String,
	password: String,
	email: String,
    regTime:Date
});

//职位
const positionSchema = new mongoose.Schema({
    id:Number,
	names: String,
	sex: String,
	position: String,
	phone: Number,
    partment:String,
    time:String,
    status:String
});

//model集合：用户
const User = mongoose.model('user',userSchema);
//model集合：职位
const Position = mongoose.model('position',positionSchema);

module.exports = {User,Position};